<script type="text/javascript" src="${base}/scripts/cggl/cgdtzdetail.js"></script>
<div id="cgdtz_tabs" class="easyui-tabs" detail="true" data-options="fit:true,border:false">


<div title="采购单">
    <table style="width: 99%;margin: 5px" class="tb tab-t t-bor">
        <input type="hidden" id="cgdtzdetail_id" value="${(cgd.id)!}"/>
        <col width="110px"/>
        <col width=""/>
        <col width="110px"/>
        <col width=""/>
        <col width="110px"/>
        <col width=""/>
        <tr>
            <th>采购单号：</th>
            <td colspan="3">
            ${(cgd.cgdh)!}
            </td>
            <th>采购时间：</th>
            <td>${(cgd.cgsj?date)!}</td>
        </tr>
        <tr>
            <th>采购合同：</th>
            <td>
            <#if cgd?? && cgd.cght??>
                <a href="javascript:void(0);" onclick="viewtzCghtDetail('${(cgd.cght.id)!}');">
                    <span>${(cgd.cght.htbm)!}</span>
                </a>
            </#if>
            </td>
            <th>采购类型：</th>
            <td>
            <#if cgd?? && cgd.cglx?? && cgd.cglx=="cgrk" >采购入库<#else>
                <#if cgd?? && cgd.cglx?? && cgd.cglx=="zddh" >直达到货<#elseif cgd?? && cgd.cglx?? && cgd.cglx=="bght">
                    保供采购<#else>统配采购</#if>
            </#if>
            </td>

            <th>供&nbsp;&nbsp;应&nbsp;&nbsp;商：</th>
            <td>
            ${(cgd.gys.jc)!}
            </td>
        </tr>
        <tr>
            <th>发货公司：</th>
            <td>
            ${(cgd.fhgs.qc)!}
            </td>
            <th>发货日期：</th>
            <td>
            ${(cgd.fhrq?date)!}
            </td>
            <th>到货日期：</th>
            <td>
            ${(cgd.jhdhrq?date)!}
            </td>
        </tr>
        <tr>
            <th>到货仓库：</th>
            <td>
            ${(cgd.dzck.mc)!}
            </td>
            <th>承运单位：</th>
            <td>
            ${(cgd.ysdw.qc)!}
            </td>
            <th>承运号：</th>
            <td>
            ${(cgd.cyh)!}
            </td>
        </tr>
        <tr>
        <#if cgd?? && cgd.cglx?? && cgd.cglx!="zddh" >
            <th>已验收：</th>
            <td>
                <#if cgd?? && cgd.sfys??&&cgd.sfys>是<#else>否</#if>
            </td>
            <th>验收时间：</th>
            <td>
                <#if cgd?? && cgd.ysrq??>${(cgd.ysrq?date)!}</#if>
            </td>
            <th>验收人：</th>
            <td>
            ${(cgd.ysr.xm)!}
            </td>
        </#if>
        </tr>
        <tr>
        <#if cgd?? && cgd.cglx?? && cgd.cglx!="zddh" >
            <th>已入库：</th>
            <td>
                <#if cgd?? && cgd.yrk??&&cgd.yrk>是<#else>否</#if>
            </td>
            <th>入库时间：</th>
            <td>
                <#if cgd?? && cgd.rksj??>${(cgd.rksj?date)!}</#if>
            </td>
            <th>入库人：</th>
            <td>
            ${(cgd.rkr.xm)!}
            </td>
        </#if>
        </tr>
        <tr>
            <th>采购公司：</th>
            <td>
            ${(cgd.cggs.qc)!}
            </td>
            <th>联系电话：</th>
            <td>
            ${(cgd.lxrdh)!}
            </td>
            <th>税率(%)：</th>
            <td>
            ${(cgd.sl)!}
            </td>
        </tr>
        <tr>
            <th>申报公司：</th>
            <td>
            ${(cgd.sbgs.jc)!}
            </td>
            <th>申报部门：</th>
            <td>
            ${(cgd.sbbm.qc)!}
            </td>
            <th>申&nbsp;报&nbsp;&nbsp;人：</th>
            <td>
            ${(cgd.sbr.xm)!}
            </td>
        </tr>
    <#if cgd??&&cgd.cglx??&& cgd.cglx=="zddh">
        <tr>
            <th>销售单号：</th>
            <td colspan="3">
                <#if cgd??&&cgd.xsd??>${(cgd.xsd.xsdh)!}</#if>
            </td>
            <th>综合服务费(%)：</th>
            <td>${(cgd.cght.ll?string(",##0.0000"))!}</td>
        </tr>
        <tr>
            <th>销售合同：</th>
            <td>
            ${(cgd.xsd.xsht.htbm)!}
            </td>
            <th>客户</th>
            <td>${(cgd.xsd.kh.jc)!}</td>
            <th>提货人</th>
            <td>${(cgd.xsd.thr)!}</td>
        </tr>
    </#if>
        <tr>
            <th>状态：</th>
            <td>
            <#if cgd??&&cgd.zt??&&cgd.zt == 'ybc'>已保存<#else><#if cgd??&&cgd.zt??&&cgd.zt == 'ytj'>已提交<#else>
                已审批</#if></#if>
            </td>
            <th>备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注：</th>
            <td colspan="3">
            ${(cgd.bz)!}
            </td>
        </tr>
        <tr>
            <th>制&nbsp;单&nbsp;&nbsp;人：</th>
            <td>${(cgd.createUser.xm)!}</td>
            <th>制单时间：</th>
            <td>${(cgd.dateCreated?datetime)!}</td>
        </tr>
    </table>
</div>
<div title="采购明细">
    <table id="cgdtz_cgdmx_table" class="easyui-datagrid" url="${base}/cggl/cgdgl/cgdgl_cgmx?cgd.id=${(cgd.id)!}"
           rownumbers="true" fit="true" style="width: 1855px" fitColumns="false" showFooter="true">
        <thead>
        <tr>
            <th data-options="field:'wzgg.oldcode',width:150,align: 'center'" rowspan="2">老物资编码</th>
        <#--<th data-options="field:'wzgg.code',width:50" rowspan="2">新物资编码</th>-->
            <th data-options="field:'wzgg.name',width:100,align: 'center'" rowspan="2">物资名称</th>
            <th data-options="field:'wzgg.ggxh',width:120,align: 'center'" rowspan="2">规格型号</th>
            <th data-options="field:'wzgg.dw',width:50,align: 'center'" rowspan="2">单位</th>
            <th data-options="field:'cd.z',width:80,align: 'center'" rowspan="2">产地</th>
            <th colspan="2">发货</th>
            <th data-options="field:'jzfs.z',width:50,align: 'center'" rowspan="2">记重方式</th>
            <th colspan="3">到货</th>
            <th data-options="field:'kh.khbm',width:120,align: 'center'" rowspan="2">卡号</th>
            <th data-options="field:'hsj',width:150,formatter:formatJeForHtml,align: 'right'" rowspan="2">含税单价(元)</th>
            <th data-options="field:'bhsj',width:150,formatter:formatJeForHtml,align: 'right'" rowspan="2">不含税单价(元)</th>
            <th data-options="field:'ph',width:50,align: 'center'" rowspan="2">牌号</th>
            <th data-options="field:'jsdh',width:150,align: 'center'" rowspan="2">结算单号</th>
        </tr>

        <tr>
            <th data-options="field:'js',width:100,formatter:formatSlForHtml,align: 'right'">件数</th>
            <th data-options="field:'sbsl',width:150,formatter:formatSlForHtml,align: 'right'">数量</th>
            <th data-options="field:'rkjs',width:100,formatter:formatSlForHtml,align: 'right'">件数</th>
            <th data-options="field:'rkjz',width:100,formatter:formatSlForHtml,align: 'right'">件重</th>
            <th data-options="field:'rksl',width:150,formatter:formatSlForHtml,align: 'right'">数量</th>
        </tr>
        </thead>
    </table>
</div>
<div title="费用明细">
    <table id="cgdtz_cgdfy_table" class="easyui-datagrid" url="${base}/cggl/cgdgl/cgdgl_cgfy?cgd.id=${(cgd.id)!}"
           rownumbers="true" fit="true" fitColumns="true" showFooter="true">
        <thead>
        <tr>
            <th data-options="field:'sydw.qc',width:50,align: 'center'">收益单位</th>
            <th data-options="field:'fylb.fykmjc',width:50,align: 'center'">费用类别</th>
            <th data-options="field:'jfsl',width:30,formatter:formatSlForHtml,align: 'right'">计费数量</th>
            <th data-options="field:'dj',width:30,formatter:formatJeForHtml,align: 'right'">单价(元)</th>
            <th data-options="field:'je',width:30,formatter:formatJeForHtml,align: 'right'">总金额(元)</th>
            <th data-options="field:'bz',width:50,align: 'center'">备注</th>
        </tr>
        </thead>
    </table>
</div>
</div>